<template>
  <view class="volunteerApplication">
    <uni-head title="技术档案"></uni-head>
    <div class="tabs">
      <view class="tabItem" :class="{ tabActive: tabActiveIndex == index }" v-for="(item, index) in tabList"
        :key="index" @click="tabClick(index)">
        {{ item.name }}
      </view>
    </div>
    <div class="content">
      <template v-if="!tabActiveIndex">
        <u--form labelPosition="left" :model="formData" ref="uForm" labelWidth="220rpx">
          <u-form-item label="人员类型" borderBottom>
            <text>{{ formData.personnelCategoryName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="长病长休" borderBottom>
            <text>{{ formData.ifLongSickLeave ? '是' : '否' }}</text>
          </u-form-item>
          <u-form-item label="是否师资" borderBottom>
            <text>{{ formData.ifTeacher ? '是' : '否' }}</text>
          </u-form-item>
          <u-form-item label="民族" borderBottom>
            <text>{{ formData.person && formData.person.nationName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="政治面貌" borderBottom>
            <text>{{ formData.person && formData.person.politicsStatusName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="家庭住址" borderBottom>
            <text>{{ formData.person && formData.person.homeAddress || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="籍贯" borderBottom>
            <text>{{ formData.person && formData.person.nativePlace || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="婚姻状况" borderBottom>
            <text>{{ formData.person && formData.person.maritalStatusName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="工作标识" borderBottom>
            <text>{{ formData.work && formData.work.workIdentificationName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="管理标识" borderBottom>
            <text>{{ formData.work && formData.work.managementIdentificationName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="角色身份" borderBottom>
            <text>{{ formData.work && formData.work.identityTypeName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="工作岗位" borderBottom>
            <text>{{ formData.work && formData.work.postName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="职称" borderBottom>
            <text>{{ formData.work && formData.work.workTitleName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="职称时间" borderBottom>
            <text>{{ formData.work && formData.work.workTitleTime || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="级别" borderBottom>
            <text>{{ formData.work && formData.work.workLevelName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="职称职位" borderBottom>
            <text>{{ formData.work && formData.work.nominalPostName || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="劳动班制" borderBottom>
            <text>{{ formData.work && formData.work.workShiftCode || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="入路时间" borderBottom>
            <text>{{ formData.work && formData.work.approachTime || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="参工时间" borderBottom>
            <text>{{ formData.work && formData.work.entryWorkDate || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="现岗日期" borderBottom>
            <text>{{ formData.work && formData.work.presentEmploymentDate || '暂无' }}</text>
          </u-form-item>
          <u-form-item label="一线情况" borderBottom>
            <text>{{ formData.work && formData.work.frontLineSituationName || '暂无' }}</text>
          </u-form-item>
          <!-- <u-form-item label="提职时间" borderBottom>
            <text>2011/05/06</text>
          </u-form-item>
          <u-form-item label="提职岗位">
            <text>xxxxx</text>
          </u-form-item> -->
        </u--form>
      </template>

      <template v-else>
        <myEmpty emptyText="该功能还未开发"></myEmpty>
      </template>
    </div>
  </view>
</template>

<script>
import myEmpty from "@/components/empty/empty.vue";
import { userCurrentInfo } from "@/common/api/user/user.js";
export default {
  components: {
    myEmpty,
  },
  data() {
    return {
      tabActiveIndex: 0,
      tabList: [
        {
          name: "基础信息",
        },
        {
          name: "岗位合格证",
        },
        {
          name: "其他证书",
        },
      ],
      formData: {
      },
    };
  },
  onLoad() {
    // 获取用户信息
    this.getUserCurrentInfo();
  },
  methods: {
    // tab切换
    tabClick(index) {
      this.tabActiveIndex = index;
    },

    // 获取用户信息
    getUserCurrentInfo() {
      userCurrentInfo({}).then((res) => {
        if (res && res.code == 200 && res.data) {
          this.formData = res.data;
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.volunteerApplication {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  /* background: linear-gradient(170deg, #dfeafc 0%, #ffffff 100%); */
  overflow: hidden;
  padding: 0 32rpx 48rpx;

  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("~@/static/images/personalInfo/bj.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  }

  .tabs {
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;

    .tabItem {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      margin-bottom: 33rpx;

      font-weight: 500;
      font-size: 28rpx;
      color: #68696a;

      &::after {
        content: "";
        opacity: 0;
        display: block;
        width: 36rpx;
        height: 6rpx;
        margin-top: 13rpx;
        background: #0f5bd3;
        border-radius: 3rpx;
      }
    }

    .tabActive {
      font-weight: bold;
      font-size: 32rpx;
      color: #000000;

      &::after {
        opacity: 1;
      }
    }
  }

  .content {
    position: relative;
    z-index: 1;
    flex: 1;
    height: 100%;
    overflow: auto;
    padding: 0 24rpx 38rpx 30rpx;

    background: #ffffff;
    box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 0, 0, 0.01);
    border-radius: 16rpx;

    /deep/.u-form-item__body {
      padding: 36rpx 0;
    }

    /deep/.u-form-item__body__left__content__label {
      font-size: 32rpx;
      color: #323232;
    }

    /deep/.u-line {
      border-color: #eeeeee !important;
      border-bottom: 2rpx solid #eeeeee !important;
    }

    text {
      width: 100%;
      display: block;
      font-weight: 500;
      font-size: 32rpx;
      color: #323232;
      text-align: right;
    }
  }
}
</style>
